﻿<Controls:MetroWindow x:Class="Shoozla.View.ID3TagEditorView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:behaviours="clr-namespace:MahApps.Metro.Behaviours;assembly=MahApps.Metro" 
        xmlns:s="clr-namespace:Shoozla"
        xmlns:sv="clr-namespace:Shoozla.View"
        xmlns:svm="clr-namespace:Shoozla.ViewModel"
        Width="550" Height="250"
        ShowWindowCommands="False" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False" ShowTitleBar="False" ShowIconOnTitleBar="False">
    
    <i:Interaction.Behaviors>
        <behaviours:BorderlessWindowBehavior ResizeWithGrip="False" AutoSizeToContent="False" />
    </i:Interaction.Behaviors>
    <DockPanel LastChildFill="True" MinHeight="115">
        <Grid  Margin="0,5,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="50"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="60"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="120"/>
            </Grid.ColumnDefinitions>
            <TextBlock Text="{Binding Song.ShortName, Mode=OneWay}" Width="510"  HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="0" Grid.ColumnSpan="3" FontSize="30" FontWeight="SemiBold" TextWrapping="NoWrap"></TextBlock>
            <TextBlock Text="Artist" HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="1" Grid.Column="0" FontSize="12" ></TextBlock>
            <TextBlock Text="Title"  HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="2" Grid.Column="0" FontSize="12"></TextBlock>
            <TextBlock Text="Album" HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="3" Grid.Column="0" FontSize="12"></TextBlock>
            <TextBlock Text="Genre"  HorizontalAlignment="left" Margin="7,0,0,0" VerticalAlignment="Center"  Grid.Row="4" Grid.Column="0" FontSize="12"></TextBlock>
            <TextBlock Text="Year" Grid.Column="0" Grid.Row="5"  Margin="7,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="12"></TextBlock>
            <TextBox Text="{Binding Song.Artist, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" MinWidth="362"  FontSize="12" HorizontalAlignment="Stretch"  VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Text="{Binding Song.Title, Mode=TwoWay}" Grid.Row="2"  Grid.Column="1" MinWidth="362" HorizontalAlignment="Stretch"  FontSize="12"   VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Text="{Binding Song.AlbumName, Mode=TwoWay}" Grid.Row="3"  Grid.Column="1" MinWidth="362" HorizontalAlignment="Stretch"   FontSize="12"   VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Text="{Binding Song.Genre, Mode=TwoWay}" Grid.Row="4"  Grid.Column="1" MinWidth="362"   FontSize="12" HorizontalAlignment="Left"   VerticalAlignment="Center" Foreground="Black"></TextBox>
            <TextBox Grid.Column="1" Grid.Row="5"  MinWidth="362"  HorizontalAlignment="Stretch"  FontSize="12"  VerticalAlignment="Center" >
                <Binding Path="Song.Year" Mode="TwoWay">
                    <Binding.ValidationRules>
                        <s:YearValidationRule />
                    </Binding.ValidationRules>
                </Binding>
            </TextBox>
           
            <Grid Grid.RowSpan="5" Grid.Row="1" Grid.Column="2" Margin="0,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="120"/>
                </Grid.ColumnDefinitions>    
                <Image Source="{Binding Song.ImageBitmap}"  Width="105" Height="105" VerticalAlignment="Top" HorizontalAlignment="Center">
                    <Image.BitmapEffect>
                        <DropShadowBitmapEffect Color="black" Direction="320" ShadowDepth="20" Softness="2" Opacity="0.5"/>
                    </Image.BitmapEffect>
                </Image>
                <WrapPanel Grid.Column="0" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Button  Width="25" Padding="0" Height="15" Name="btnStop" ToolTip="Stop" Command="{Binding Path=CmdStopSong}" Background="{DynamicResource AccentColorBrush}" >
                            <Controls:MetroImage HorizontalAlignment="Center" Source="{StaticResource appbar_stop}" Height="15" Width="17" />
                    </Button>
                    <Button Width="25" Padding="0" Height="15" Name="btnPlay"  ToolTip="Play"  Command="{Binding Path=CmdPlaySong}" Background="{DynamicResource AccentColorBrush}" >
                        <Controls:MetroImage HorizontalAlignment="Center" Source="{StaticResource appbar_sound_3}" Height="15" Width="17" />
                    </Button>
                    <Button VerticalAlignment="Center" Width="25" Height="15" Padding="0" Grid.Column="0" Grid.Row="2" Background="{DynamicResource AccentColorBrush}" Command="{Binding Path=CmdSearchSingleCover}"   ToolTip="Search a cover for this song" Name="searchSingleCoverBT" >
                        <Controls:MetroImage HorizontalAlignment="Center" Source="{StaticResource appbar_magnify}" Height="15" Width="17" />
                    </Button>
                    <Button VerticalAlignment="Center" Width="25" Height="15" Padding="0"  Command="{Binding Path=CmdFileCover}" Background="{DynamicResource AccentColorBrush}" ToolTip="Choose an image from the disk" Name="addFileCoverBT" >
                        <Controls:MetroImage HorizontalAlignment="Center" Source="{StaticResource appbar_add}" Height="15" Width="17" />
                    </Button>
                </WrapPanel>
            </Grid>
                <MediaElement x:Name="audio"></MediaElement>
       
          
            <WrapPanel  HorizontalAlignment="Center" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3">
                <Button Content="Cancel" Width="70" Padding="0" Height="15" Name="cancelBT"  ToolTip="close wihtout saving" Command="{Binding Path=CmdCancel}"/>
                 <Button Content="Save" Width="70" Padding="0" Height="15" Margin="5,0,0,0"  Name="saveBT" Command="{Binding Path=CmdSaveSong}" IsDefault="True" />
            </WrapPanel>
        </Grid>
    </DockPanel>
</Controls:MetroWindow>
